package org.wangnian.validationdemo.service;

import org.springframework.validation.annotation.Validated;
import org.wangnian.validationdemo.groups.user.InsertUser;
import org.wangnian.validationdemo.model.UserDetails;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

public interface UserService {

    /**
     *
     * @param username 用户名
     * @return
     */
    void add(@NotBlank(message = "用户名不能为空")String username,
             @NotBlank(message = "密码不能为空")String password);

    void add(@Valid @NotNull(message = "用户详细信息不能为空",groups = InsertUser.class) UserDetails userDetails);
}